package top.lyc829.leetcode.T171;

public class Solution {

    public int titleToNumber(String s) {
        int count = 0;

        for (int i = 0; i < s.length(); i++) {
            int tmp = s.charAt(i) - 'A' + 1;
            count = count * 26 + tmp;
        }

        return count;
    }

    public static void main(String[] args) {
        Solution s = new Solution();
        System.out.println(s.titleToNumber("AB"));
    }

}
